﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Teacher_Head : System.Web.UI.UserControl
{
    DBClass dbobj = new DBClass();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["UserID"] == null)
        {
            Label1.Visible = false;
            LinkButton1.Visible = false;
        }
        else
        {
            Label1.Text = dbobj.ExecScalar("select TeacherName from Teacher where TeacherID='" + Session["UserID"].ToString() + "'");
            Label1.Visible = true;
            LinkButton1.Visible = true;           
        }
    }
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        Session["UserID"] = null;
        Response.Redirect("~/Login.aspx");
    }
}